package com.stnet.bases;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ReadProperties {
	private String propName;
	
	public ReadProperties(String propName) {
		super();
		this.propName = propName;
	}

	public Properties getProperties() {
		InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(propName);   
		  Properties p = new Properties();   
		  try {   
		   p.load(inputStream);   
		  } catch (IOException e1) {   
		   e1.printStackTrace();   
		  }
		  return p;
	}
	
	public static void main(String[] args) {
		ReadProperties rp = new ReadProperties("onlinerecharge.properties");
		Properties p = rp.getProperties();
		String PARTNER = p.getProperty("customer.id");// 代理商id
		String KEY = p.getProperty("customer.key");
		String PRODUCT_URL = p.getProperty("producturl");
		String directurl  = p.getProperty("directurl");
		String notifyurl  = p.getProperty("notifyurl");
		System.out.println(p.get("testuser.id"));
		System.out.println(PARTNER);
		System.out.println(KEY);
		System.out.println(PRODUCT_URL);
		System.out.println(directurl );
		System.out.println(notifyurl );
	}
}
